class Jogador < ActiveRecord::Base
	validates :nome, :presence => true, :length => { :within => 5..100 }
	validates :email, :presence => true, 
					  :uniqueness => true, 
					  :length => { :within => 5..100 }, 
					  :format => { :with => /^[^@][\w.-]+@[\w.-]+[.][a-z]{2,4}$/i }
	validates :senha, :presence => true,
					  :confirmation => true
	
	has_attached_file :avatar #, :styles => { :medium => "300x300>", :thumb => "100x100>" }
	
	#attr_accessor :avatar_original_filename

     has_and_belongs_to_many :missaos
end
